package com.company.clientscard.main.widgets.general;

import com.company.clientscard.shared.proxyManager.ProxyManager;
import com.google.gwt.view.client.AsyncDataProvider;
import com.google.gwt.view.client.HasData;
import com.google.gwt.view.client.Range;

public class TableDataProvider<T> extends AsyncDataProvider<T> {
	private ProxyManager<T> manager;

	public TableDataProvider(ProxyManager<T> manager) {
		this.manager = manager;
	}

	@Override
	protected void onRangeChanged(final HasData<T> display) {
		final Range range = display.getVisibleRange();
		manager.setObjectList(range.getStart(), range.getLength(), display);
	}

}
